/* Copyright (c) 2011 by crossmobile.org
 *
 * CrossMobile is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 2.
 *
 * CrossMobile is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with CrossMobile; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

package org.xmlvm.iphone;

import android.view.Gravity;

public final class UITextAlignment {

    public static final int Left = 0;
    public static final int Center = 1;
    public static final int Right = 2;

    private UITextAlignment() {
    }

    static int alignmentToGravity(int alignment) {
        switch (alignment) {
            case Center:
                return Gravity.CENTER;
            case Right:
                return Gravity.RIGHT;
            case Left:
            default:
                return Gravity.LEFT;
        }
    }

    static int gravityToAlignment(int gravity) {
        switch (gravity) {
            case Gravity.CENTER:
                return Center;
            case Gravity.RIGHT:
                return Right;
            case Gravity.LEFT:
            default:
                return Left;
        }
    }
}
